<ion-header>
  <ion-toolbar class="orange-bar">
    <ion-buttons slot="start">
      <ion-button color="light" (click)="doPop()">
        <ion-icon name="ios-arrow-back"></ion-icon>
      </ion-button>
    </ion-buttons>
    <ion-title>{{type['name'] || product['name']}}</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form [formGroup]="formModel">
    <ion-list>
      <ion-item>
        <ion-label position="stacked">金额</ion-label>
        <ion-input type="number" formControlName="amount" [placeholder]="amountPlaceholder"></ion-input>
      </ion-item>
      <ion-text *ngIf="!formModel.get('amount').valid && !formModel.get('amount').hasError('required')" class="err-msg" color="tertiary" padding-start>
        {{formModel.getError('thousandTimes', ['amount']) || '金额限制' + amountPlaceholder}}
      </ion-text>
      <ion-item>
        <ion-label position="stacked">期限</ion-label>
        <ion-select formControlName="period" interface="popover" placeholder="请选择">
          <ion-select-option *ngFor="let period of periodList" [value]="period['val']">{{period['txt']}}</ion-select-option>
        </ion-select>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">筹款时间</ion-label>
        <ion-select formControlName="investPeriod" interface="popover" placeholder="7~10天">
          <ion-select-option *ngFor="let investPeriod of investPeriodList" [value]="investPeriod">{{investPeriod}}天</ion-select-option>
        </ion-select>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">还款方式</ion-label>
        <ion-select formControlName="repaymentType" interface="popover" placeholder="请选择">
          <ion-select-option *ngFor="let type of repaymentType" [value]="type">
            {{type | i18nSelect:configService.productRepaymentTypeList}}
          </ion-select-option>
        </ion-select>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">借款用途</ion-label>
        <ion-textarea formControlName="purpose" rows="2" placeholder="10个字以上简介借款用途"></ion-textarea>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">借款描述</ion-label>
        <ion-textarea formControlName="description" rows="4" placeholder="篇幅20~500字，说明借款用途及还款来源"></ion-textarea>
      </ion-item>
    </ion-list>
    <div text-center>
      <a text-center class="link-btn bg-orange" [class.disabled]="!this.formModel.valid" (click)="doApply()">下一步</a>
    </div>
  </form>
</ion-content>
